<template>
  <div>
    <headIndex :hindex="num" @getCat="valueChange" />
    <!----轮播+中央新闻--->
    <div class="main clearfix">
      <div class="lunbo fl">
        <el-carousel height="386px">
          <el-carousel-item v-for="(item, index) in xwdtList" :key="index">
            <div class="lunbo_img">
              <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
              <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              <p>{{ item.infotitle }}</p>
            </div>
          </el-carousel-item>
        </el-carousel>
      </div>
      <!---中央新闻--->
      <div class="centerNews fr">
        <div class="centerNews-head flex flex-align-center flex-pack-justify">
          <div class="h1">中央新闻</div>
          <div class="more"><a :href="'/list?id=' + centerId">更多>></a></div>
        </div>
        <ul>
          <li v-for="(item,index) in centerlist">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>          
          </li>
        </ul>
      </div>
    </div>

    <!---单图片+图片轮播--->
    <div class="main clearfix mt25">
      <div class="img-fl fl">
        <a :href="'/article?id=' + guanggao_left.infoid">
          <img :src="guanggao_left.picurl" />
        </a>  
      </div>
    
      <div class="img-fr fr">
        <el-carousel height="90px">
          <el-carousel-item v-for="(item, index) in guanggao_right" :key="index">
            <a :href="'/article?id=' + item.infoid"><img :src="item.picurl" /></a>
          </el-carousel-item>
        </el-carousel>
      </div>
    </div>

    <!----工作动态+政策法规---->
    <div class="main clearfix mt35">
      <!--工作动态-->
      <div class="department fl">
        <div class="gzdt-head">
          <div class="more fr"><a :href="'/list?id=' + zbywid">更多>></a></div>
        </div>
        <dl class="clearfix">
          <dt :class="{on:zbywIndex==index}" v-for="(item, index) in zbyw_menu" :key="index" @mouseover="zbywIndex = index">{{item.categoryname}}</dt>
        </dl>
        <ul v-if="zbywIndex == 0">
          <li v-for="(item,index) in zbywlist1">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="zbywIndex == 1">
          <li v-for="(item,index) in zbywlist2">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="zbywIndex == 2">
          <li v-for="(item,index) in zbywlist3">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
      </div>
      <!--政策法规-->
      <div class="department fr">
        <div class="zcfg-head">
          <div class="more fr"><a :href="'/list?id=' + zcfgid">更多>></a></div>
        </div>
        <dl class="clearfix">
          <dt :class="{on:zcfgIndex==index}" v-for="(item, index) in zcfg_menu" :key="index" @mouseover="zcfgIndex = index">{{item.categoryname}}</dt>
        </dl>
        <ul v-if="zcfgIndex == 0">
          <li v-for="(item,index) in zcfglist1">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="zcfgIndex == 1">
          <li v-for="(item,index) in zcfglist2">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="zcfgIndex == 2">
          <li v-for="(item,index) in zcfglist3">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="zcfgIndex == 3">
          <li v-for="(item,index) in zcfglist4">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
      </div>
    </div>  
    
    <!----公告发布+分队---->
    <div class="main clearfix mt35">
      <!--公告发布-->
      <div class="department fl">
        <div class="depart-head">
          <div class="more fr"><a :href="'/list?id=' + ggfbid">更多>></a></div>
        </div>
        <dl class="clearfix">
          <dt :class="{on:departIndex==index}" v-for="(item, index) in ggfb_menu" :key="index" @mouseover="departIndex = index">{{item.categoryname}}</dt>
        </dl>
        <ul v-if="departIndex == 0">
          <li v-for="(item,index) in ggfblist1">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="departIndex == 1">
          <li v-for="(item,index) in ggfblist2">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="departIndex == 2">
          <li v-for="(item,index) in ggfblist3">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
      </div>
      <!--分队-->
      <div class="department fr">
        <div class="depart-head">
          <div class="more fr"><a :href="'/list?id=' + fdid">更多>></a></div>
        </div>
        <dl class="clearfix">
          <dt :class="{on:UnitIndex==index}" v-for="(item, index) in unit_menu" :key="index" @mouseover="UnitIndex = index">{{item.categoryname}}</dt>
        </dl>
        <ul v-if="UnitIndex == 0">
          <li v-for="(item,index) in fdlist1">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="UnitIndex == 1">
          <li v-for="(item,index) in fdlist2">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="UnitIndex == 2">
          <li v-for="(item,index) in fdlist3">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="UnitIndex == 3">
          <li v-for="(item,index) in fdlist4">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="UnitIndex == 4">
          <li v-for="(item,index) in fdlist5">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="UnitIndex == 5">
          <li v-for="(item,index) in fdlist6">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
      </div>

    </div>
    <!----保障精英---->
    <div class="main mt35">
      <div class="elite">
        <div class="elite-head flex flex-align-center flex-pack-justify">
          <div class="h1">
            <!-- 保障精英 -->
            <ul class="clearfix">
              <li v-for="(item,index) in bzjy_menu" :class="{on:bzjyIndex==index}" @mouseover="getBao(item,index)">{{item.categoryname}}</li>
            </ul>
          </div>
          <div class="more"><a :href="'/list?id=' + bzjyid">更多>></a></div>
        </div>
        <div class="elite-cont" v-if="bzjyIndex == 0" >
          <vue-seamless-scroll
            :data="listData0"
            :class-option="classOption"
            class="warp"
          >
            <ul class="ul-item">
              <li class="li-item" v-for="(item, index) in listData0" :key="index">
                <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
                <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              </li>
            </ul>
          </vue-seamless-scroll>
        </div>
        <div class="elite-cont" v-if="bzjyIndex == 1" >
          <vue-seamless-scroll
            :data="listData1"
            :class-option="classOption"
            class="warp"
          >
            <ul class="ul-item">
              <li class="li-item" v-for="(item, index) in listData1" :key="index">
                <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
                <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              </li>
            </ul>
          </vue-seamless-scroll>
        </div>
        <div class="elite-cont" v-if="bzjyIndex == 2" >
          <vue-seamless-scroll
            :data="listData1"
            :class-option="classOption"
            class="warp"
          >
            <ul class="ul-item">
              <li class="li-item" v-for="(item, index) in listData2" :key="index">
                <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
                <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              </li>
            </ul>
          </vue-seamless-scroll>
        </div>
        <div class="elite-cont" v-if="bzjyIndex == 3" >
          <vue-seamless-scroll
            :data="listData1"
            :class-option="classOption"
            class="warp"
          >
            <ul class="ul-item">
              <li class="li-item" v-for="(item, index) in listData3" :key="index">
                <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
                <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              </li>
            </ul>
          </vue-seamless-scroll>
        </div>
        <div class="elite-cont" v-if="bzjyIndex == 4" >
          <vue-seamless-scroll
            :data="listData1"
            :class-option="classOption"
            class="warp"
          >
            <ul class="ul-item">
              <li class="li-item" v-for="(item, index) in listData4" :key="index">
                <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
                <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              </li>
            </ul>
          </vue-seamless-scroll>
        </div>
        <div class="elite-cont" v-if="bzjyIndex == 5" >
          <vue-seamless-scroll
            :data="listData1"
            :class-option="classOption"
            class="warp"
          >
            <ul class="ul-item">
              <li class="li-item" v-for="(item, index) in listData5" :key="index">
                <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
                <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              </li>
            </ul>
          </vue-seamless-scroll>
        </div>

      </div>
    </div>
    <!----天天读报+书香军营+稿件统计---->
    <div class="main mt35 clearfix">
      <!---天天读报--->
      <div class="newspaper fl">
          <div class="newspaper-head">
            <div class="more fr"><a :href="'/list?id=' + paperid">更多>></a></div>
          </div>
          <div class="paper-img flex flex-align-center flex-pack-center">
            <!-- v-for="(item, index) in bookList" -->
              <div class="img">
                <img src="../../assets/img/paper_07.jpg" />
              </div>
              <div class="img">
                <img src="../../assets/img/paper_09.jpg" />
              </div>
          </div>
          <div class="news clearfix">
            <ul>
              <li class="li-item" v-for="(item, index) in paperlist" :key="index">
                <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
                <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
              </li>
            </ul>
          </div>
      </div> 

      <!---书香军营--->
      <div class="book fl">
          <div class="book-head">
            <div class="more fr"><a :href="'/list?id=' + bookid">更多>></a></div>
          </div>
          <ul class="clearfix">
            <li class="li-item" v-for="(item, index) in booklist" :key="index">
              <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><img :src="item.picurl"/></a>
              <a v-else :href="'/article?id=' + item.infoid"><img :src="item.picurl"/></a>
            </li>
          </ul>
      </div>

      <!---稿件统计--->
      <div class="manuscript fl">
        <div class="statistics">
          <div class="statistics-head"></div>
          <div style="padding: 40px 10px 0;">
            <el-table :data="tableData" border >
              <el-table-column label="排名" align="center" width="50">
                <template slot-scope="scope">
                    <span>{{ scope.$index + 1 }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="tougaoren" label="单位" align="center"></el-table-column>
              <el-table-column prop="count" label="发稿量" align="center" width="60"></el-table-column>
            </el-table>
          </div>         
        </div>
        <!-----要训统计----->
        <div class="statistics" style="margin-top:15px">
          <div class="yxtj-head"></div>
          <div style="padding: 40px 10px 0;">
            <el-table :data="tableDatayx" height="97" border >
              <el-table-column label="排名" align="center" width="50">
                <template slot-scope="scope">
                    <span>{{ scope.$index + 1 }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="infotitle" label="单位" align="center"></el-table-column>
              <el-table-column prop="summary" label="发稿量" align="center" width="60"></el-table-column>
            </el-table>
          </div>         
        </div>

        <div class="email">
          <a :href="'/email'">
            <img src="../../assets/img/email.jpg" />
          </a>          
        </div>

      </div>
    </div>
    


    <!-- <div class="department fl">
        <div class="depart-head">
          <div class="more fr"><a :href="'/list?id=' + bmid">更多>></a></div>
        </div>
        <dl class="clearfix">
          <dt :class="{on:departIndex==index}" v-for="(item, index) in depart_menu" :key="index" @mouseover="departIndex = index">{{item.categoryname}}</dt>
        </dl>
        <ul v-if="departIndex == 0">
          <li v-for="(item,index) in bmlist1">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="departIndex == 1">
          <li v-for="(item,index) in bmlist2">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
        <ul v-if="departIndex == 2">
          <li v-for="(item,index) in bmlist3">
            <a v-if="item.returnurl && item.returnurl != '' " :href="item.returnurl"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
            <a v-else :href="'/article?id=' + item.infoid"><i class="iconfont icon-yuandianxiao"></i>{{ item.infotitle }}</a>
          </li>
        </ul>
      </div> -->



    <footIndex />
  </div>   
</template>
<style scoped  lang="scss">

::v-deep .el-carousel__indicators--horizontal{
  left:85%;
  right: -14%;
}
::v-deep .el-table__body tr,
::v-deep .el-table__body td {
  padding: 0;
  height: 24px;
}
::v-deep .el-table .el-table__header-wrapper th, ::v-deep .el-table .el-table__fixed-header-wrapper th {
    padding: 0;
    height: 24px;
}
.warp {
    width: 1090px;
    height:224px;
    margin: 30px auto;
    overflow: hidden;
    ul {
        list-style: none;
        padding: 0;
        margin: 0 auto;
        &.ul-item {
        display: flex;
        .li-item {
            width: 170px;
            height: 226px;
            margin-right: 16px;
            color: #fff;
            text-align: center;
            font-size: 30px;
            img{
              width: 170px;
              height: 226px;
            }
        }
        }
    }
}
</style>
<script setup name="index">
import headIndex from "./components/headIndex/index.vue";
import footIndex from "./components/footIndex/index.vue";
import vueSeamlessScroll from 'vue-seamless-scroll'
import { listpassInfo,leftCategorylist, statisticsNum } from "@/api/yxzx/info";
export default {
  components: {
    headIndex,
    footIndex,
    vueSeamlessScroll
  },
  data() {
    return {
      loading: true,
      num: 0,
      xwdtList: [],
      zbyw_menu: [],
      zbywIndex: 0,
      zcfg_menu: [],
      zcfgIndex: 0,
      ggfb_menu: [],
      ggfbIndex: 0,
      depart_menu: [],
      departIndex: 0,
      unit_menu: [],
      UnitIndex: 0,
      listData0: [],
      listData1: [],
      listData2: [],
      listData3: [],
      listData4: [],
      listData5: [],
      listData6: [],
      listData7: [],
      listData8: [],
      listData9: [],
      bzjy_menu: [],
      bzjyIndex:0,
      classOption: {
        autoPlay: true,
        step: 3,
        direction: 2,
        singleWidth: 120,
        switchSingleStep: 120,
        switchDelay: 200,
        navigation: false
      },
      tableData: [],
      tableDatayx: [],
      fId: '',
      centerId: '',
      centerlist: [],
      zbywid: '',
      zbywlist1: [],
      zbywlist2: [],
      zbywlist3: [],
      pageindex: 1,
      pagesize: 20,
      zcfgid: '',
      zcfglist1: [], 
      zcfglist2: [], 
      zcfglist3: [],
      zcfglist4: [],
      ggfbid: '',
      ggfblist1: [],
      ggfblist2: [],
      ggfblist3: [],
      bmid: '',
      bmlist1: [],
      bmlist2: [],
      bmlist3: [],
      fdid: '',
      fdlist1: [],
      fdlist2: [],
      fdlist3: [],
      fdlist4: [],
      fdlist5: [],
      fdlist6: [],
      bzjyid: '',
      paperid: '',
      paperlist: [],
      bookid: '',
      booklist: [],
      guanggao_left: {},
      guanggao_right: [],
    };
  },
  created() {
    this.getNum()
  },
  methods: {
    valueChange(val) {
      val.map((item) => {
        if (item.categoryname == "图片新闻") {
          listpassInfo(item.categoryid, "", 1, 4).then((response) => {
            this.xwdtList = response.InfoList;
          });
        } else if (item.categoryname == "中央新闻"){
          this.centerId = item.categoryid
          listpassInfo(item.categoryid, "", 1, 8).then((response) => {
            this.centerlist = response.InfoList;
          });
        } else if (item.categoryname == "综保要闻"){
          this.zbywid = item.categoryid
          leftCategorylist(item.categoryid).then((response) => {
            this.zbyw_menu = response
            listpassInfo(response[0].categoryid, "", 1, 6).then((response) => {
              this.zbywlist1 = response.InfoList;
            });
            listpassInfo(response[1].categoryid, "", 1, 6).then((response) => {
              this.zbywlist2 = response.InfoList;
            });
            listpassInfo(response[2].categoryid, "", 1, 6).then((response) => {
              this.zbywlist3 = response.InfoList;
            });
          })
        } else if (item.categoryname == "政策法规"){
          this.zcfgid = item.categoryid
          leftCategorylist(item.categoryid).then((response) => {
            this.zcfg_menu = response
            listpassInfo(response[0].categoryid, "", 1, 6).then((response) => {
              this.zcfglist1 = response.InfoList;
            });
            listpassInfo(response[1].categoryid, "", 1, 6).then((response) => {
              this.zcfglist2 = response.InfoList;
            });
            listpassInfo(response[2].categoryid, "", 1, 6).then((response) => {
              this.zcfglist3 = response.InfoList;
            });
            listpassInfo(response[3].categoryid, "", 1, 6).then((response) => {
              this.zcfglist4 = response.InfoList;
            });
          })
        } else if (item.categoryname == "公告发布") {
          this.ggfbid = item.categoryid
          leftCategorylist(item.categoryid).then((response) => {
            this.ggfb_menu = response
            listpassInfo(response[0].categoryid, "", 1, 6).then((response) => {
              this.ggfblist1 = response.InfoList;
            });
            listpassInfo(response[1].categoryid, "", 1, 6).then((response) => {
              this.ggfblist2 = response.InfoList;
            });
            listpassInfo(response[2].categoryid, "", 1, 6).then((response) => {
              this.ggfblist3 = response.InfoList;
            });
          })
        } else if (item.categoryname == "部门"){
          this.bmid = item.categoryid
          leftCategorylist(item.categoryid).then((response) => {
            this.depart_menu = response
            listpassInfo(response[0].categoryid, "", 1, 6).then((response) => {
              this.bmlist1 = response.InfoList;
            });
            listpassInfo(response[1].categoryid, "", 1, 6).then((response) => {
              this.bmlist2 = response.InfoList;
            });
            listpassInfo(response[2].categoryid, "", 1, 6).then((response) => {
              this.bmlist3 = response.InfoList;
            });
          })
        } else if (item.categoryname == "分队"){
          this.fdid = item.categoryid
          leftCategorylist(item.categoryid).then((response) => {
            this.unit_menu = response
            listpassInfo(response[0].categoryid, "", 1, 6).then((response) => {
              this.fdlist1 = response.InfoList;
            });
            listpassInfo(response[1].categoryid, "", 1, 6).then((response) => {
              this.fdlist2 = response.InfoList;
            });
            listpassInfo(response[2].categoryid, "", 1, 6).then((response) => {
              this.fdlist3 = response.InfoList;
            });
            listpassInfo(response[3].categoryid, "", 1, 6).then((response) => {
              this.fdlist4 = response.InfoList;
            });
            listpassInfo(response[4].categoryid, "", 1, 6).then((response) => {
              this.fdlist5 = response.InfoList;
            });
            listpassInfo(response[5].categoryid, "", 1, 6).then((response) => {
              this.fdlist6 = response.InfoList;
            });
          })
        } else if (item.categoryname == "保障精英"){
          leftCategorylist(item.categoryid).then((response) => {
            this.bzjy_menu = response
            this.bzjyid = response[0].categoryid
            response.map((ele,index) => {
              listpassInfo(ele.categoryid, "", 1, 100).then((h) => {
                this['listData'+index] = h.InfoList;
              });
            })
          })
          listpassInfo(item.categoryid, "", 1, 100).then((response) => {
            this.listData = response.InfoList;
          });
        } else if (item.categoryname == "要训统计"){
          listpassInfo(item.categoryid, "", 1, 6).then((response) => {
            this.tableDatayx = response.InfoList;
          });
        }
         else if (item.categoryname == "天天读报"){
          this.paperid = item.categoryid
          listpassInfo(item.categoryid, "", 1, 6).then((response) => {
            this.paperlist = response.InfoList;
          });
        } else if (item.categoryname == "书香军营"){
          this.bookid = item.categoryid
          listpassInfo(item.categoryid, "", 1, 8).then((response) => {
            this.booklist = response.InfoList;
          });
        } else if (item.categoryname == "首页广告左"){
          listpassInfo(item.categoryid, "", 1, 1).then((response) => {
            this.guanggao_left = response.InfoList[0];
          });
        } else if (item.categoryname == "首页广告右"){
          listpassInfo(item.categoryid, "", 1, 100).then((response) => {
            this.guanggao_right = response.InfoList;
          });
        }     
      })
    },
     
    getBao(item,index){
      this.bzjyIndex = index
      this.bzjyid = this.bzjy_menu[index].categoryid
    },
    // 文章列表
    getList(id,num) {
      listpassInfo(
        id,
        "",
        this.pageindex,
        num
      ).then((response) => {
        this.newsList = response.InfoList;
        this.retotal = response.PageInfo.recordCount;
        this.reCount = response.PageInfo.recordCount;
      });
    },

    // 稿件统计
    getNum(){
      statisticsNum().then((res) => {
          this.tableData = res.data
      })
    },
    // 下级栏目
    tree(data, name) {
      for (let i = 0; i < data.length; i++) {
        let item = data[i]
        if (item.categoryname === name) {
          return item.categoryid
        } else {
          if (item.xiajicategorylist && item.xiajicategorylist.length > 0) {
            let res = tree(item.xiajicategorylist, name)
            if (res) return res
          }
        }
      }
    },

  },
};
</script>
